package com.mab.apipassenger.controller;

import com.mab.apipassenger.service.UserService;
import com.msb.internalcommon.dto.ResponseResult;
import com.msb.internalcommon.request.VerificationCodeDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @Auther: jiudianliu
 * @Date: 2023/5/26 - 05 - 26 - 17:47
 * @Description: com.mab.apipassenger.controller
 * @version: 1.0
 */
@RestController
public class UserController {

    @Autowired
    private UserService userService ;

    @GetMapping("/users")
    public ResponseResult getUser(HttpServletRequest request){

        //从Http请求中获取AccessToken
        String authorization = request.getHeader("Authorization");

        return userService.getUserByAccessToken(authorization) ;
    }
}
